var manageTableObj;
$(function () {
    syb("#selectSignOrgName");
    $("#selectSignOrgName option").remove();
    $("#selectSignOrgName").prepend("<option value='0'>全部</option>");

    manageTableObj = $('#myTable').dataTableExtend({
        "ajax": sysInfo.basePath + "/zs/warning_configure/query_system_config.do",
        "scrollX": "true",//是否开启横项滚动
        "fixedColumns": {//锁定列，只有开启scrollX时才生效
            "leftColumns": 2,//左侧锁定2列
            "rightColumns": 1//右侧锁定1列
        },
        "fnServerParams": function (aoData) {
            aoData.warningType = $("#warningType").val();
            var signOrgId = $('#selectSignOrgName').val();
            if (signOrgId == 0) {
                signOrgId = "";
            }
            aoData.signOrgId = signOrgId;
            var checkResult = checkHasSybAuth($('#selectSignOrgName option'));
            if (!checkResult) {
                aoData.isAll = "0";
            }
        },
        "aoColumns": [
            {
                "title": "预警ID",
                "data": "id",
                "orderable": false,
                "visible": false
            },
            {
                "title": "序号",
                "render": function (data, type, full, meta) {
                    return meta.row + 1;
                },
                "orderable": false
            },
            {
                "title": "所属事业部",
                "data": "signOrgName",
                "orderable": false
            },
            {
                "title": "资质过期预警（天）",
                "data": "certificateExpireWarning",
                "orderable": false,
                "render": function (data, type, full, meta) {
                    return '<div class="operability-td line-edit">' +
                        '<input type="text"  readonly value="' + data + '" onkeyup="restrictInputLength(this,3)"/>' +
                        '</div>';
                }
            },
            {
                "title": "库容预警值（个）",
                "data": "storageWarning",
                "orderable": false,
                "render": function (data, type, full, meta) {
                    return '<div class="operability-td line-edit">' +
                        '<input type="text" readonly value="' + data + '" onkeyup="restrictInputLength(this,5)"/>' +
                        '</div>';
                }
            },
            {
                "title": "审核级数",
                "data": "reviewProgression",
                "orderable": false,
                "render": function (data, type, full, meta) {
                    return '<div class="operability-td line-edit">' +
                        '<input type="text" readonly value="' + data + '" onkeyup="restrictInputLength(this,1,true)"/>' +
                        '</div>';
                }
            },
            {
                "title": "最新操作时间",
                "data": "updateTime",
                "name": "updateTime",
                "orderable": false
            },
            {
                "title": "最新操作人",
                "data": "updaterName",
                "orderable": false
            },
            {
                "title": "操作",
                "orderable": false,
                "render": function (data, type, full, meta) {
                    return '<a href="javascript:void(0)" class="iboss-link" onclick="editManage($(this),' + meta.row + ')">编辑</a>'
                }
            }
        ]
    });
});